package com.ggggeeennn.studentUser.controller.exam;

import com.ggggeeennn.common.core.controller.BaseController;
import com.ggggeeennn.common.core.domain.AjaxResult;
import com.ggggeeennn.common.core.page.TableDataInfo;
import com.ggggeeennn.exam.domain.ExamManage;
import com.ggggeeennn.studentUser.domain.Message;
import com.ggggeeennn.studentUser.service.MessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/student/message")
public class MessageController extends BaseController {

    @Autowired
    private MessageService messageService;
    @GetMapping("/list")
    public TableDataInfo getMessageList(){
        startPage();
        List<ExamManage> list = messageService.getMessageList();
        return getDataTable(list);
    }

    @PostMapping("/add")
    public AjaxResult addMessage(@RequestBody Message message){
        return toAjax(messageService.addMessage(message));
    }
}
